#ifndef _MAINWINDOW_H
#define _MAINWINDOW_H

#include <QWidget>
#include <QDialog>
#include <QUrl>
#include "tdownlad.h"

QT_BEGIN_NAMESPACE
class QDialogButtonBox;
class QFile;
class QLabel;
class QLineEdit;
class QProgressDialog;
class QPushButton;
class QSslError;
class QAuthenticator;
class QNetworkReply;

namespace Ui {
    class MainWindow;
}

class MainWindow : public QWidget
{
    Q_OBJECT

public:
    //functions
    explicit MainWindow (QWidget *parent = 0);
    ~MainWindow         ();
    void closeEvent     (QCloseEvent * event );
signals:
    void startNextDl();
public slots:
    void downloadlst();

private slots:
    void my_quit();
    void get_CUpdate();
    void updateDataReadProgress(int bytesRead, int totalBytes);
    void updateStatus(QString);
    void execute();
    void fullCheck();
    void nextDl();
    void dlError();
private:
    //vars
    Ui::MainWindow *ui;
    int                     file_dl;
    QUrl                    url;
    QNetworkReply           *reply;
    QFile                   *file;
    int                     httpGetId;
    bool                    httpRequestAborted;
    QString                 addr_server;
    int                     file_count;
    QStringList             file_list;
    QStringList             hash_list;
    int                     iterator;
    bool                    isFullCheck;
    //TDownlad *dlst;
    //functions
    QString CalcSha1(QString Path);
};

#endif // _MAINWINDOW_H
